
function isEmpty(v, allowBlank) {
	if (typeof v === 'object' || typeof v === 'function') {
		var i;
		for (i in v) {
			if (v.hasOwnProperty(i)) {
				return false;
			}
		}
		return true;
	} else {
		// not an object or function - same as before
		return v === null || v === undefined || (!allowBlank ? v === '' : false);
	}
};



var A = '';
var B = null;
var C;
var D = {};
var E = (function() {
	var private1 = 5;
	return {};
})();
var F = new Object;
var G = [];
var H = { someVal: 42 };
var I = new Ext.Panel;


if (Ext.isEmpty(A)) {
	console.debug('A is true');
} else {
	console.debug('A is false');
}

if (Ext.isEmpty(B)) {
	console.debug('B is true');
} else {
	console.debug('B is false');
}

if (Ext.isEmpty(C)) {
	console.debug('C is true');
} else {
	console.debug('C is false');
}

if (Ext.isEmpty(D)) {
	console.debug('D is true');
} else {
	console.debug('D is false');
}

if (Ext.isEmpty(E)) {
	console.debug('E is true');
} else {
	console.debug('E is false');
}

if (Ext.isEmpty(F)) {
	console.debug('F is true');
} else {
	console.debug('F is false');
}

if (Ext.isEmpty(G)) {
	console.debug('G is true');
} else {
	console.debug('G is false');
}

if (Ext.isEmpty(H)) {
	console.debug('H is true');
} else {
	console.debug('H is false');
}

if (Ext.isEmpty(I)) {
	console.debug('I is true');
} else {
	console.debug('I is false');
}

console.debug ('Now the improved function');
if (isEmpty(A)) {
	console.debug('A is true');
} else {
	console.debug('A is false');
}

if (isEmpty(B)) {
	console.debug('B is true');
} else {
	console.debug('B is false');
}

if (isEmpty(C)) {
	console.debug('C is true');
} else {
	console.debug('C is false');
}

if (isEmpty(D)) {
	console.debug('D is true');

} else {
	console.debug('D is false');
}

if (isEmpty(E)) {
	console.debug('E is true');
} else {
	console.debug('E is false');
}

if (isEmpty(F)) {
	console.debug('F is true');
} else {
	console.debug('F is false');
}

if (isEmpty(G)) {
	console.debug('G is true');
} else {
	console.debug('G is false');
}

if (isEmpty(H)) {
	console.debug('H is true');
} else {
	console.debug('H is false');
}

if (isEmpty(I)) {
	console.debug('I is true');
} else {
	console.debug('I is false');
}


